/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.LoadModel.impl;

import EA_Model.IEC61970.Core.impl.PowerSystemResourceImpl;

import EA_Model.IEC61970.Domain.PerCent;

import EA_Model.IEC61970.LoadModel.LoadModelPackage;
import EA_Model.IEC61970.LoadModel.PowerCutZone;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Power Cut Zone</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.LoadModel.impl.PowerCutZoneImpl#getCutLevel1 <em>Cut Level1</em>}</li>
 *   <li>{@link EA_Model.IEC61970.LoadModel.impl.PowerCutZoneImpl#getCutLevel2 <em>Cut Level2</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class PowerCutZoneImpl extends PowerSystemResourceImpl implements PowerCutZone {
	/**
	 * The cached value of the '{@link #getCutLevel1() <em>Cut Level1</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCutLevel1()
	 * @generated
	 * @ordered
	 */
	protected PerCent cutLevel1;

	/**
	 * The cached value of the '{@link #getCutLevel2() <em>Cut Level2</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCutLevel2()
	 * @generated
	 * @ordered
	 */
	protected PerCent cutLevel2;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected PowerCutZoneImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return LoadModelPackage.Literals.POWER_CUT_ZONE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PerCent getCutLevel1() {
		if (cutLevel1 != null && cutLevel1.eIsProxy()) {
			InternalEObject oldCutLevel1 = (InternalEObject)cutLevel1;
			cutLevel1 = (PerCent)eResolveProxy(oldCutLevel1);
			if (cutLevel1 != oldCutLevel1) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LoadModelPackage.POWER_CUT_ZONE__CUT_LEVEL1, oldCutLevel1, cutLevel1));
			}
		}
		return cutLevel1;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PerCent basicGetCutLevel1() {
		return cutLevel1;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCutLevel1(PerCent newCutLevel1) {
		PerCent oldCutLevel1 = cutLevel1;
		cutLevel1 = newCutLevel1;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LoadModelPackage.POWER_CUT_ZONE__CUT_LEVEL1, oldCutLevel1, cutLevel1));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PerCent getCutLevel2() {
		if (cutLevel2 != null && cutLevel2.eIsProxy()) {
			InternalEObject oldCutLevel2 = (InternalEObject)cutLevel2;
			cutLevel2 = (PerCent)eResolveProxy(oldCutLevel2);
			if (cutLevel2 != oldCutLevel2) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LoadModelPackage.POWER_CUT_ZONE__CUT_LEVEL2, oldCutLevel2, cutLevel2));
			}
		}
		return cutLevel2;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PerCent basicGetCutLevel2() {
		return cutLevel2;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCutLevel2(PerCent newCutLevel2) {
		PerCent oldCutLevel2 = cutLevel2;
		cutLevel2 = newCutLevel2;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LoadModelPackage.POWER_CUT_ZONE__CUT_LEVEL2, oldCutLevel2, cutLevel2));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case LoadModelPackage.POWER_CUT_ZONE__CUT_LEVEL1:
				if (resolve) return getCutLevel1();
				return basicGetCutLevel1();
			case LoadModelPackage.POWER_CUT_ZONE__CUT_LEVEL2:
				if (resolve) return getCutLevel2();
				return basicGetCutLevel2();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case LoadModelPackage.POWER_CUT_ZONE__CUT_LEVEL1:
				setCutLevel1((PerCent)newValue);
				return;
			case LoadModelPackage.POWER_CUT_ZONE__CUT_LEVEL2:
				setCutLevel2((PerCent)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case LoadModelPackage.POWER_CUT_ZONE__CUT_LEVEL1:
				setCutLevel1((PerCent)null);
				return;
			case LoadModelPackage.POWER_CUT_ZONE__CUT_LEVEL2:
				setCutLevel2((PerCent)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case LoadModelPackage.POWER_CUT_ZONE__CUT_LEVEL1:
				return cutLevel1 != null;
			case LoadModelPackage.POWER_CUT_ZONE__CUT_LEVEL2:
				return cutLevel2 != null;
		}
		return super.eIsSet(featureID);
	}

} //PowerCutZoneImpl
